package com.dd.mapper;

import com.dd.pojo.Address;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AddressMapper {
    @Select("select * from address")
    public List<Address> findAll();

    @Select("select * from address where id=#{id}")
    public Address findById(Integer id);


    @Insert("insert into address(first,last,costs,user_id) values(#{first},#{last},#{costs},#{user_id})")
    public int addAddress(Address address);
}
